import Vue from 'vue'
import VueRouter from 'vue-router'

import Home from '../views/Home.vue'
import Write from '../views/Write.vue'
// import Write from '../views/Write.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/index'
  },
  {
    path: '/index',
    component: Home,
    children: [
      {
        path: '/',
        redirect: 'write'
      },
      {
       
        path: 'write',
       
        component: Write
      },
      {
        path: 'read',
        component: () => import( '../views/Read.vue')
      }
    ]
  },
  {
    path: '/log/:type',
    component: () => import( '../views/WriteDetail.vue')
  },
  {
    path: '/logDetail/:type',
    component: () => import( '../views/LogDetail.vue')
  },
  {
    path: '/Read',
   
    component: () => import( '../views/Read.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
